package com.liming.common.pojo.vo.cart.web;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.liming.common.serializer.CentToYuanSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author liming
 * @date 2025/1/22
 */
@Data
@NoArgsConstructor
@Schema(description = "购物车中商品信息VO")
public class ProductInCartVO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "购物车项ID")
    private Long id;

    @Schema(description = "商品ID")
    private Long productId;

    @Schema(description = "商品名称")
    private String productName;

    @Schema(description = "商品数量")
    private Integer quantity;

    @Schema(description = "商品主图链接地址")
    private String mainImageUrl;

    @Schema(description = "商品价格")
    @JsonSerialize(using = CentToYuanSerializer.class)
    private Integer price;

    @Schema(description = "优惠券后价格")
    private Double afterCouponPrice;
}
